]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/volume: Use same icon for slider/top bar
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 7 Oct 2022 12:21:08 +0000 (14:21 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 9 Feb 2023 19:34:55 +0000 (19:34 +0000)
Currently the icon in the top bar indicates the volume level, while
the icon next to the slider indicates the type of output (speaker
or headphone). The speaker- and volume icons are quite similar,
but different enough to feel inconsistent, so use the volume one
in both cases.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5940

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2505>

js/ui/status/volume.js

index bd49cc3ae8a0783103b586a2f39b4840c4ad5dd4..79950458d253ab608444e2720c9ea7fd3a9718bd 100644 (file)
@@ -204,6 +204,7 @@ const StreamSlider = GObject.registerClass({
         let muted = this._stream.is_muted;
         this._changeSlider(muted
             ? 0 : this._stream.volume / this._control.get_vol_max_norm());
+        this._updateIcon();
         this.emit('stream-updated');
     }
 
@@ -217,6 +218,10 @@ const StreamSlider = GObject.registerClass({
             this._updateVolume();
     }
 
+    _updateIcon() {
+        this.iconName = this.getIcon();
+    }
+
     getIcon() {
         if (!this._stream)
             return null;
@@ -308,9 +313,13 @@ class OutputStreamSlider extends StreamSlider {
             return;
 
         this._hasHeadphones = hasHeadphones;
+        this._updateIcon();
+    }
+
+    _updateIcon() {
         this.iconName = this._hasHeadphones
             ? 'audio-headphones-symbolic'
-            : 'audio-speakers-symbolic';
+            : this.getIcon();
     }
 });